package com.abacus.pay.dao;

import java.util.Calendar;

import com.abacus.pay.model.PayVoucher;

public class SaveData implements Runnable {

	@Override
	public void run() {
		TransactionStrategy.getInstance();
		TransactionStrategy.getInstance().begin();
		PayVoucherDao dao = new PayVoucherDaoImpl();

		for (int i = 0; i < 10; i++) {
			PayVoucher payVoucher = new PayVoucher(new Long(i), Calendar.getInstance());
			payVoucher.setCalendar("2011-12-12");
			dao.save(payVoucher);
			System.out.println(payVoucher.getDate());
		}

		TransactionStrategy.getInstance().commit();
	}

}
